package com.supermap.business.cloud.live;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtils;
import com.supermap.dubbo.api.cloud.live.ArtemisService;
import org.springframework.web.bind.annotation.*;

/**
 * @Author:zhoujian
 * @Desciption:大棚实景
 * @date:2019-09-26 10:37
 * @version:v1.0.0
 */
@RestController
@RequestMapping("/cloud/live/artemis")
public class ArtemisController {

    @Reference(timeout =  20000)
    private ArtemisService artemisService;

    /**
     * 获取区域列表
     */
    @GetMapping("getRegionsList")
    public JSONUtils getRegionsList()
    {
        return  artemisService.getRegionsList();
    }

    /**
     * 根据区域编号获取下级监控点列表
     * @param regionIndexCode 区域编码
     */
    @PostMapping("getCamerasByRegionIndexCode")
    public JSONUtils getCamerasByRegionIndexCode(@RequestParam("regionIndexCode") String regionIndexCode)
    {
        return  artemisService.getCamerasByRegionIndexCode(regionIndexCode);
    }

    /**
     * 获取监控点预览取流URL
     * @param cameraIndexCode 摄像头编码
     * @return
     */
    @PostMapping("getCameraPreviewURLs")
    public JSONUtils getCameraPreviewURLs(@RequestParam("cameraIndexCode") String cameraIndexCode)
    {
        return  artemisService.getCameraPreviewURLs(cameraIndexCode);
    }

    /**
     * 手动抓图
     * @param cameraIndexCode 摄像头编码
     * @return
     */
    @PostMapping("getManualCapture")
    public JSONUtils getManualCapture(@RequestParam("cameraIndexCode") String cameraIndexCode)
    {
        return  artemisService.getManualCapture(cameraIndexCode);
    }

}